﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Globalization;

namespace EIM_Accounting.BLL
{
    public class CM010104
    {
        private readonly Accounting.DAL.Holiday holiday = new Accounting.DAL.Holiday();

        internal void addBatch(List<Accounting.Model.Holiday> lstHoliday, List<string[]> calcMonth)
        {
            holiday.AddBatch(lstHoliday, calcMonth);
        }

        internal List<System.DateTime> getSelectDate(string strMonth, string staffID)
        {
            DataSet dsf = holiday.GetList(" substr(Holiday, 0, 7) ='" + strMonth + "' and StaffID= " + staffID);
            List<System.DateTime> backList = new List<System.DateTime>();
            foreach (DataRow dr in dsf.Tables[0].Rows)
            {
                if (dr["Holiday"] != null && dr["Holiday"].ToString() != "")
                {
                    backList.Add(DateTime.ParseExact(dr["Holiday"].ToString(), "yyyyMMdd", CultureInfo.InvariantCulture));
                }
            }

            return backList;
        }
    }
}